home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 32
/
Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso
/
Aminet
/
dev
/
lang
/
Python152_Src.lha
/
Python152_Source
/
Amiga_Misc
/
testset
/
test_misc.pyc
(
.txt
)
< prev
Wrap
Python Compiled Bytecode
|
1998-11-12
|
2KB
|
62 lines
# Source Generated with Decompyle++
# File: in.pyc (Python 1.5)
import os
import amiga
import time
import Dos
TestError = 'FAILED --- Amiga misc '
def testeq(res, check, info):
if res != check:
raise TestError + info
def testcrc32(str, check):
testeq(amiga.crc32(str), check, 'amiga.crc32')
print 'TEST amiga.crc32'
testcrc32('', -1)
testcrc32('a', 390611388)
testcrc32('abc', -891568579)
testcrc32('abcdefghijklmnopqrstuvwxyz', -1277644990)
testcrc32('ABCDEFGHIJKLMNOPQRSTUVWXYZ', 1409845213)
testcrc32('12345678901234567890123456789012345678901234567890123456789012345678901234567890 The quick brown Fox jumps over the lazy Dog', 58971606)
print 'amiga.crc32 TEST OK'
print 'TEST Dos.touch, filedates, Amiga dates/times'
try:
os.remove('t:touchtest')
except os.error:
pass
try:
Dos.touch('t:touchtest')
except:
raise TestError + 'Dos.touch'
try:
datestr = ('18-Jul-98', '13:33:33')
datestamp = Dos.StrToDate(datestr[0], datestr[1])
unixtime = Dos.DS2time(datestamp)
unixtimestr = time.ctime(unixtime)
testeq(unixtime, 900765213.0, 'Dos.DS2time')
testeq(unixtimestr, 'Sat Jul 18 13:33:33 1998', 'Dos.DS2time')
Dos.touch('t:touchtest', unixtime)
ds = Dos.Examine('t:touchtest')[Dos.fib_Date]
testeq(ds, datestamp, 'Dos.touch')
datestamp = Dos.DateStamp()
datestr = Dos.DateToStr(datestamp)
unixtime = Dos.DS2time(datestamp)
unixtimestr = time.ctime(unixtime)
Dos.SetFileDate('t:touchtest', datestamp)
ds = Dos.Examine('t:touchtest')[Dos.fib_Date]
testeq(ds, datestamp, 'Dos.SetFileDate')
print 'Dos.touch/Amigadates TEST OK'
except:
raise TestError + 'Dos filedates/Amiga dates'